# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=gocryptfs
pkgver=1.8.0
pkgrel=0
pkgdesc="Encrypted overlay filesystem written in Go"
url="https://github.com/rfjakob/gocryptfs"
arch="all !mips !mips64" # FTBFS
license="MIT"
makedepends="go coreutils bash openssl-dev"
depends="fuse"
options="chmod-clean !check" # test requires fuse kernel module
source="https://github.com/rfjakob/gocryptfs/releases/download/v$pkgver/gocryptfs_v${pkgver}_src-deps.tar.gz
	remove_pandoc.patch"
builddir="$srcdir/gopath/src/github.com/rfjakob/$pkgname"

prepare() {
	mkdir -p "$srcdir/gopath/src/github.com/rfjakob"
	ln -rTsf "$srcdir/${pkgname}_v${pkgver}_src-deps" "$srcdir/gopath/src/github.com/rfjakob/$pkgname"
	default_prepare
}

build() {
	export GOPATH="$srcdir/gopath"
	make build
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	rm -rf "$pkgdir"/usr/share/licenses
}

sha512sums="fa27181788ddfe4024f41e335c27e6102e90f08abb63c8125e7aca82baf2aea43b8a365ad320545f85bd71a8254a36b6bd2fc2a14815a17adcb39a21ad5640d1  gocryptfs_v1.8.0_src-deps.tar.gz
602468bf28273a99361d6610bec75c81deb5e7d42026f82d6fcab06dabd3312dcf2b1ba2411e02e86bc4842af9d53e6ef023013b93afd39bd1823ad76ff8a157  remove_pandoc.patch"
